﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YXQ.Common.Helper;
using YXQ.Dao.ViewModel;
using YXQ.Service;

namespace YXQ.Manager.control
{
    public partial class projectdetail : BaseControl
    {
        public int tpid = 0;
        BJModel bjmodel = new BJModel();
        SJModel sjmodel = new SJModel();
        YSJSModel ysjsmodel = new YSJSModel();
        ZBBModel zbbmodel = new ZBBModel();
        GCBModel gcbmodel = new GCBModel();
        ZGCSModel zgcsmodel = new ZGCSModel();
        DAModel damodel = new DAModel();
        CWModel cwmodel = new CWModel();
        int bjreid = 0;
        int sjreid = 0;
        int ysreid = 0;
        int zbreid = 0;
        int gcreid = 0;
        int zgreid = 0;
        int dareid = 0;
        int cwreid = 0;
        StringBuilder sbscript = new StringBuilder();
        protected void Page_Load(object sender, EventArgs e)
        {
            sbscript.Append("<script type='text/javascript'>$(function(){ ");
            if (Request["tpid"] != null)
            {
                tpid = Convert.ToInt32(Request["tpid"]);
                hfTpid.Value = tpid.ToString();
                var mudle = CenterService.mudleService.GetOneById(tpid);
                if (mudle != null)
                {
                    ltrMudle.Text = mudle.Title;
                }
                switch (tpid)
                {
                    case 2:
                        ltrJC.Text = "基础验收<br/>(房建基础完工转序)";
                        trzt.Visible = true;
                        trjc.Visible = true;
                        break;
                    case 3:
                        ltrJC.Text = "土石方验收";

                        trjc.Visible = true;
                        trzt.Visible = false;
                        break;
                    default:
                        trzt.Visible = false;
                        trjc.Visible = false;
                        break;
                }
                if (Request["bjreid"] != null)
                {
                    bjreid = Convert.ToInt32(Request["bjreid"]);
                    ltrTime.Text = Request["create"];

                    sbscript.Append("$('#" + ct1.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','报建部');");

                    GetBJ();
                }
                if (Request["sjreid"] != null)
                {
                    sjreid = Convert.ToInt32(Request["sjreid"]);
                    ltrSj.Text = Request["create"];

                    sbscript.Append("$('#" + ct2.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','设计部');");

                    GetSJ();
                }
                if (Request["ysreid"] != null)
                {
                    ysreid = Convert.ToInt32(Request["ysreid"]);
                    ltrYSJS.Text = Request["create"];
                    sbscript.Append("$('#" + ct3.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','预算结算部');");
                    GetYSJS();
                }
                if (Request["zbreid"] != null)
                {
                    zbreid = Convert.ToInt32(Request["zbreid"]);
                    ltrZBB.Text = Request["create"];
                    sbscript.Append("$('#" + ct4.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','招标办');");
                    GetZBB();
                }
                if (Request["gcreid"] != null)
                {
                    gcreid = Convert.ToInt32(Request["gcreid"]);
                    ltrGCB.Text = Request["create"];
                    sbscript.Append("$('#" + ct5.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','工程部');");
                    GetGCB();
                }
                //if (Request["zgreid"] != null)
                //{
                //    zgreid = Convert.ToInt32(Request["zgreid"]);
                //    ltrZGCS.Text = Request["create"];
                //    sbscript.Append("$('#ptabs').tabs('select','总工程师');");
                //    GetZGCS();
                //}
                if (Request["dareid"] != null)
                {
                    dareid = Convert.ToInt32(Request["dareid"]);
                    ltrDA.Text = Request["create"];
                    sbscript.Append("$('#" + ct6.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','档案室');");
                    GetDAS();
                }
                if (Request["cwreid"] != null)
                {
                    cwreid = Convert.ToInt32(Request["cwreid"]);
                    ltrCW.Text = Request["create"];
                    sbscript.Append("$('#" + ct7.ClientID + "').attr(\"selected\",'true'); ");
                    //sbscript.Append("$('#ptabs').tabs('select','财务室');");
                    GetCW();
                }

            }
            sbscript.Append(" })");
            sbscript.Append("</script>");
            ltrSelTab.Text = sbscript.ToString();
            hfId.Value = reqID.ToString();


            LoadHistory();

            if (!IsPostBack)
            {

                GetData();

            }
            BindUserData();
        }
        #region 根据用户权限设置用户是否对控件有修改权限
        /// <summary>
        /// 根据用户权限设置用户是否对控件有修改权限
        /// 
        /// </summary>
        private void BindUserData()
        {
            var client = string.Empty;
            StringBuilder sb = new StringBuilder();
            sb.Append("<script type='text/javascript'>");
            sb.Append("$( function(){");
            //sb.Append("$('#"+ct2.ClientID+"').attr(\"selected\",'true'); ");
            List<string> ids = new List<string>();
            if (AdminUser != null)
            {
                if (!string.IsNullOrEmpty(AdminUser.Depart))
                {
                    if (!AdminUser.Depart.Contains("A0001"))
                    {
                        ids.Add(ct1.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct1.ClientID + "').attr(\"selected\",'true'); ");
                        //sb.Append("$('#ptabs').tabs('select','报建部');");
                    }
                    if (!AdminUser.Depart.Contains("A0002"))
                    {
                        ids.Add(ct2.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct2.ClientID + "').attr(\"selected\",'true'); ");
                       // sb.Append("$('#ptabs').tabs('select','设计部');");
                    }
                    if (!AdminUser.Depart.Contains("A0003"))
                    {
                        ids.Add(ct3.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct3.ClientID + "').attr(\"selected\",'true'); ");
                        //sb.Append("$('#ptabs').tabs('select','预算结算部');");
                    }
                    if (!AdminUser.Depart.Contains("A0004"))
                    {
                        ids.Add(ct4.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct4.ClientID + "').attr(\"selected\",'true'); ");
                        //sb.Append("$('#ptabs').tabs('select','招标办');");
                    }
                    if (!AdminUser.Depart.Contains("A0005"))
                    {
                        ids.Add(ct5.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct5.ClientID + "').attr(\"selected\",'true'); ");
                        //sb.Append("$('#ptabs').tabs('select','工程部');");
                    }
                    //if (!AdminUser.Depart.Contains("A0006"))
                    //{
                    //    ids.Add(ct6.ClientID);
                    //}
                    //else
                    //{
                    //    sb.Append("$('#ptabs').tabs('select','总工程师');");
                    //}
                    if (!AdminUser.Depart.Contains("A0007"))
                    {
                        ids.Add(ct6.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct6.ClientID + "').attr(\"selected\",'true'); ");
                       // sb.Append("$('#ptabs').tabs('select','档案室');");
                    }
                    if (!AdminUser.Depart.Contains("A0008"))
                    {
                        ids.Add(ct7.ClientID);
                    }
                    else
                    {
                        sb.Append("$('#" + ct7.ClientID + "').attr(\"selected\",'true'); ");
                        //sb.Append("$('#ptabs').tabs('select','财务室');");
                    }
                }
                else
                {
                    ids.Add(ct1.ClientID);
                    ids.Add(ct2.ClientID);
                    ids.Add(ct3.ClientID);
                    ids.Add(ct4.ClientID);
                    ids.Add(ct5.ClientID);
                    //ids.Add(ct6.ClientID);
                    ids.Add(ct6.ClientID);
                    ids.Add(ct7.ClientID);
                   // sb.Append("$('#ptabs').tabs('select','报建部');");
                    sb.Append("$('#" + ct1.ClientID + "').attr(\"selected\",'true'); ");
                }

                foreach (var s in ids)
                {
                    sb.Append(" $('#" + s + "').find('select').each(function(e){$(this).attr('disabled','disabled');});");
                    sb.Append(" $('#" + s + "').find('textarea').each(function(e){$(this).attr('class','inputsdb').attr('disabled','disabled');});");
                    sb.Append(" $('#" + s + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                    sb.Append(" $('#" + s + "').find('input').each(function(e){$(this).attr('class','inputsdb').attr('disabled','disabled');});");
                    //sb.Append(" $('#" + s + "').find('input[type=text]').each(function(e){  var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}  });");
                }

               
                sb.Append("});");

                sb.Append("</script>");
            }
            if (ids.Count > 0)
            {

                ltrscript.Text = sb.ToString();
            }

        }
        #endregion

        #region 获取历史记录列表
        /// <summary>
        /// 获取历史记录列表
        /// </summary>
        private void LoadHistory()
        {
            List<BJModel> bjmdls = CenterService.bJService.GetByProjectId(reqID);
            repBJ.DataSource = bjmdls;
            repBJ.DataBind();
            List<SJModel> sjmdls = CenterService.sJService.GetByProjectId(reqID);
            repSJ.DataSource = sjmdls;
            repSJ.DataBind();
            List<YSJSModel> ysjsmdls = CenterService.ySJSService.GetByProjectId(reqID);
            repYSJS.DataSource = ysjsmdls;
            repYSJS.DataBind();
            List<ZBBModel> zbbmdls = CenterService.zBBService.GetByProjectId(reqID);
            repZBB.DataSource = zbbmdls;
            repZBB.DataBind();
            List<GCBModel> gcbmdls = CenterService.gCBService.GetByProjectId(reqID);
            repGCB.DataSource = gcbmdls;
            repGCB.DataBind();
            //List<ZGCSModel> zgcsmdls = CenterService.zGCSService.GetByProjectId(reqID);
            //repZGCS.DataSource = zgcsmdls;
            //repZGCS.DataBind();
            List<DAModel> damdls = CenterService.dAService.GetByProjectId(reqID);
            repDA.DataSource = damdls;
            repDA.DataBind();
            List<CWModel> cwmdls = CenterService.cWService.GetByProjectId(reqID);
            repCW.DataSource = cwmdls;
            repCW.DataBind();

        }
        #endregion



        private void GetData()
        {
            GetBJ();
            GetSJ();
            GetYSJS();
            GetZBB();
            GetGCB();
            // GetZGCS();
            GetDAS();
            GetCW();
        }
        #region 获取财务
        /// <summary>
        /// 获取财务
        /// </summary>
        private void GetCW()
        {
            if (cwreid > 0)
            {
                cwmodel = CenterService.cWService.GetOneByProjectId(reqID, cwreid);
                
            }
            else
            {
                cwmodel = CenterService.cWService.GetOneByProjectId(reqID);
            }
            zbbmodel = CenterService.zBBService.GetOneByProjectId(reqID);

            if (zbbmodel != null) {
                ltrSgdw.Text = zbbmodel.zbdw;
                ltrSjdw.Text = zbbmodel.sjdw;
                ltrJldw.Text = zbbmodel.jldw;
                ltrKcdw.Text = zbbmodel.kcdw;
                ltrGsdw.Text = zbbmodel.gsdw;
                ltrZjdw.Text = zbbmodel.zjdw;
            }

            if (cwmodel != null)
            {

                ////工程款应付
                //gckyf.Value = cwmodel.gckyf.ToString();

                ////工程款已付
                //gckyif.Value = cwmodel.gckyif.ToString();

                ////设计费应付
                //sjfyf.Value = cwmodel.sjfyf.ToString();

                ////设计费已付
                //sjfyif.Value = cwmodel.sjfyif.ToString();

                ////监理费应付
                //jlfyf.Value = cwmodel.jlfyf.ToString();

                ////监理费已付
                //jlfyif.Value = cwmodel.jlfyif.ToString();

                ////勘察费应付
                //kcfyf.Value = cwmodel.kcfyf.ToString();

                ////勘察费已付
                //kcfyif.Value = cwmodel.kcfyif.ToString();

                ////采购材料应付
                //cgclyf.Value = cwmodel.cgclyf.ToString();

                ////采购材料已付
                //cgclyif.Value = cwmodel.cgclyif.ToString();

                ////跟审费应付
                //gsfyf.Value = cwmodel.gsfyf.ToString();

                ////跟审费已付
                //gsfyif.Value = cwmodel.gsfyif.ToString();

                ////造价咨询费应付
                //zjzxfyf.Value = cwmodel.zjzxfyf.ToString();

                ////造价咨询费已付
                //zjzxfyif.Value = cwmodel.zjzxfyif.ToString();

                ////招标代理费应付
                //zbdlfyf.Value = cwmodel.zbdlfyf.ToString();

                ////招标代理费已付
                //zbdlfyif.Value = cwmodel.zbdlfyif.ToString();

                ////其他费用应付
                //qtfyyf.Value = cwmodel.qtfyyf.ToString();

                ////其他费用已付
                //qtfyyif.Value = cwmodel.qtfyyif.ToString();

                //其他费用描述
                qtfyms.Value = cwmodel.qtfyms;

                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct7.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrCWScript.Text = sb.ToString();

            }
        }
        #endregion
        #region 获取档案室
        /// <summary>
        /// 获取档案室
        /// </summary>
        private void GetDAS()
        {
            if (dareid > 0)
            {
                damodel = CenterService.dAService.GetOneByProjectId(reqID, dareid);
            }
            else
            {
                damodel = CenterService.dAService.GetOneByProjectId(reqID);
            }
            if (damodel != null)
            {


                //工程结算审计提交情况
                sjjs.Value = damodel.sjjs.ToString();
                // dajdother.Value=damodel.dajdother.

                //档案交底
                dajd.Value = damodel.dajd.ToString();
                dajdother.Value = damodel.dajdother;
                //基础验收
                jcys.Value = damodel.jcys.ToString();
                jcysother.Value = damodel.jcysother;
                //主体验收
                ztys.Value = damodel.ztys.ToString();
                ztysother.Value = damodel.ztysother;
                //档案专项验收
                dzzx.Value = damodel.dzzx.ToString();
                dzzxother.Value = damodel.dzzxother;
                //完工验收
                wgys.Value = damodel.wgys.ToString();
                wgysother.Value = damodel.wgysother;
                //移交结算
                yjjs.Value = damodel.yjjs.ToString();
                yjjsother.Value = damodel.yjjsother;
                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct6.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrDAScript.Text = sb.ToString();

            }

        }
        #endregion
        #region 获取总工程师
        /// <summary>
        /// 获取总工程师
        /// </summary>
        //private void GetZGCS()
        //{
        //    if (zgreid > 0)
        //    {
        //        zgcsmodel = CenterService.zGCSService.GetOneByProjectId(reqID,zgreid);
        //    }
        //    else
        //    {

        //        zgcsmodel = CenterService.zGCSService.GetOneByProjectId(reqID);
        //    }
        //    if (zgcsmodel != null)
        //    {


        //        //工程技术控制
        //        gcjs.Value = zgcsmodel.gcjs.ToString();

        //        //工程收方控制
        //        gcsf.Value = zgcsmodel.gcsf.ToString();

        //        //工程中间验收
        //        gcys.Value = zgcsmodel.gcys.ToString();

        //        //工程验收控制
        //        jggl.Value = zgcsmodel.jggl.ToString();

        //        //StringBuilder sb = new StringBuilder();
        //        //sb.Append("<script type='text/javascript'>");
        //        //sb.Append("$(function(){"); 
        //        //sb.Append(" $('#" + ct6.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
        //        //sb.Append("});");
        //        //sb.Append("</script>");
        //        //ltrGCBScript.Text = sb.ToString();
        //    }
        //}
        #endregion
        #region 获取工程部
        /// <summary>
        /// 获取工程部
        /// </summary>
        private void GetGCB()
        {
            if (gcreid > 0)
            {
                gcbmodel = CenterService.gCBService.GetOneByProjectId(reqID, gcreid);
            }
            else
            {
                gcbmodel = CenterService.gCBService.GetOneByProjectId(reqID);
            }
            if (gcbmodel != null)
            {



                //工程推进情况
                gctj.Value = gcbmodel.gctj;

                //工程推进存在问题
                tjwt.Value = gcbmodel.tjwt;

                //需要领导解决问题
                ldjj.Value = gcbmodel.ldjj;

                //需要协调解决问题
                xyxt.Value = gcbmodel.xyxt;

                //工程质量（是否有质量事故）
                gczl.Value = gcbmodel.gczl.ToString();

                //工程安全（是否有安全事故）
                gcaq.Value = gcbmodel.gcaq.ToString();


                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct5.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrGCBScript.Text = sb.ToString();

            }
        }
        #endregion
        #region 获取招标办
        /// <summary>
        /// 招标办
        /// </summary>
        private void GetZBB()
        {
            if (zbreid > 0)
            {
                zbbmodel = CenterService.zBBService.GetOneByProjectId(reqID, zbreid);
            }
            else
            {
                zbbmodel = CenterService.zBBService.GetOneByProjectId(reqID);
            }
            if (zbbmodel != null)
            {
                //委托代理机构
                wtdljg.Value = zbbmodel.wtdljg;

                //招标方式
                zbfs.Value = zbbmodel.zbfs.ToString();

                //
                zbfsother.Value = zbbmodel.zbfsother;

                //中标单位名称
                zbdw.Value = zbbmodel.zbdw;

                //中标通知书
                zbtzs.Value = zbbmodel.zbtzs.ToString();

                //中标金额
                zbje.Value = zbbmodel.zbje.ToString();

                //履约保证金缴纳
                lybzj.Value = zbbmodel.lybzj.ToString();

                //施工合同是否签订
                sght.Value = zbbmodel.sght.ToString();

                //监理单位名称
                jldw.Value = zbbmodel.jldw;

                //监理服务费
                jlfwf.Value = zbbmodel.jlfwf.ToString();

                //跟审单位
                gsdw.Value = zbbmodel.gsdw;

                //跟审服务费
                gsfwf.Value = zbbmodel.gsfwf.ToString();

                //设计单位名称
                sjdw.Value = zbbmodel.sjdw;

                //设计服务费
                sjfwf.Value = zbbmodel.sjfwf.ToString();

                //勘察单位
                kcdw.Value = zbbmodel.kcdw;

                //勘察服务费
                kcfwf.Value = zbbmodel.kcfwf.ToString();

                //造价单位
                zjdw.Value = zbbmodel.zjdw;

                //咨询费
                zxf.Value = zbbmodel.zxf.ToString();

                //供货单位
                ghdw.Value = zbbmodel.ghdw;

                //是否签订供货合同
                ghht.Value = zbbmodel.ghht.ToString();

              
                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct4.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrZBBScript.Text = sb.ToString();

            }
        }
        #endregion
        #region 获取预算结算部
        /// <summary>
        /// 获取预算结算部
        /// </summary>
        private void GetYSJS()
        {
            if (ysreid > 0)
            {
                ysjsmodel = CenterService.ySJSService.GetOneByProjectId(reqID, ysreid);
            }
            else
            {
                ysjsmodel = CenterService.ySJSService.GetOneByProjectId(reqID);
            }
            if (ysjsmodel != null)
            {


                //
                gs.Value = ysjsmodel.gs.ToString();

                //
                gsother.Value = ysjsmodel.gsother;

                //
                ysbz.Value = ysjsmodel.ysbz.ToString();

                //
                ysbzother.Value = ysjsmodel.ysbzother;

                //
                ysps.Value = ysjsmodel.ysps.ToString();

                //
                yspsother.Value = ysjsmodel.yspsother;

                //
                zbxj.Value = ysjsmodel.zbxj.ToString();

                //
                jssc.Value = ysjsmodel.jssc.ToString();

                //结算审查50万以下金额
                jsscother.Value = ysjsmodel.jsscother;
                jsje.Value = ysjsmodel.jsje.ToString();
                //
                jsps.Value = ysjsmodel.jsps.ToString();

                //结算评审（50-200万） 金额
                jspsother.Value = ysjsmodel.jspsother;
                jspsje.Value = ysjsmodel.jspsje.ToString();
                //
                jssj.Value = ysjsmodel.jssj.ToString();

                //结算审计(200万以上)
                jssjother.Value = ysjsmodel.jssjother;
                jssjje.Value = ysjsmodel.jssjje.ToString();

                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct3.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrYSJSScript.Text = sb.ToString();
            }
        }
        #endregion
        #region 获取设计部数据
        /// <summary>
        /// 获取设计部数据
        /// </summary>
        private void GetSJ()
        {
            if (sjreid > 0)
            {
                sjmodel = CenterService.sJService.GetOneByProjectId(reqID, sjreid);
            }
            else
            {
                sjmodel = CenterService.sJService.GetOneByProjectId(reqID);
            }
            if (sjmodel != null)
            {

                //
                // ProjectId.Value = sjmodel.ProjectId.ToString();

                //
                fasj.Value = sjmodel.fasj.ToString();

                //
                fasjother.Value = sjmodel.fasjother;

                //
                dzkc.Value = sjmodel.dzkc.ToString();

                //
                dzkcother.Value = sjmodel.dzkcother;

                //
                cbsj.Value = sjmodel.cbsj.ToString();

                //
                cbsjother.Value = sjmodel.cbsjother;

                //
                sgt.Value = sjmodel.sgt.ToString();

                //
                sgtother.Value = sjmodel.sgtother;

                //
                sgtsc.Value = sjmodel.sgtsc.ToString();

                //
                sgtscother.Value = sjmodel.sgtscother;

                //
                sgtbg.Value = sjmodel.sgtbg.ToString();

                //
                sgtbgother.Value = sjmodel.sgtbgother;
                //工程技术控制
                gcjs.Value = sjmodel.gcjs;

                //工程收方控制
                gcsf.Value = sjmodel.gcsf;

                //工程中间验收
                gcys.Value = sjmodel.gcys;

                //工程验收控制
                jggl.Value = sjmodel.jggl;
                ////
                //createuserid.Value = model.createuserid.ToString();

                ////
                //createusername.Value = model.createusername.ToString();

                ////
                //createtime.Value = model.createtime.ToString();
                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct2.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrSJScript.Text = sb.ToString();
            }
        }
        #endregion
        #region 获取报建部数据
        /// <summary>
        /// 获取报建部数据
        /// </summary>
        private void GetBJ()
        {

            if (bjreid > 0)
            {

                bjmodel = CenterService.bJService.GetOneByProjectId(reqID, bjreid);
            }
            else
            {
                bjmodel = CenterService.bJService.GetOneByProjectId(reqID);
            }
            #region 报建部数据
            //报建部数据

            if (bjmodel != null)
            {
                //立项批复
                lx.Value = bjmodel.lx.ToString();

                //立项其他
                lxother.Value = bjmodel.lxother;

                //可研批复
                ky.Value = bjmodel.ky.ToString();

                //可研其他
                kyother.Value = bjmodel.kyother;

                //选址意见书
                xzyj.Value = bjmodel.xzyj.ToString();

                //选址意见书其他
                xzyjother.Value = bjmodel.xzyjother;

                //用地规划许可
                ydgh.Value = bjmodel.ydgh.ToString();

                //用地规划许可其他
                ydghother.Value = bjmodel.ydghother;

                //方案审查
                fasc.Value = bjmodel.fasc.ToString();

                //方案审查其他
                fascother.Value = bjmodel.fascother;

                //建设工程规划许可证
                jsgc.Value = bjmodel.jsgc.ToString();

                //建设工程规划许可证其他
                jsgcother.Value = bjmodel.jsgcother;

                //初设审查
                cssc.Value = bjmodel.cssc.ToString();

                //初设审查其他
                csscother.Value = bjmodel.csscother;

                //施工图备案 
                sgbt.Value = bjmodel.sgbt.ToString();

                //施工图备案其他
                sgbtother.Value = bjmodel.sgbtother;


                //质监 
                zj.Value = bjmodel.zj.ToString();

                //质监 其他
                zjother.Value = bjmodel.zjother;
                //施工许可 
                sgxk.Value = bjmodel.sgxk.ToString();
                //施工许可 其他
                sgxkother.Value = bjmodel.sgxkother;
                //安监
                aj.Value = bjmodel.aj.ToString();

                //安监其他
                ajother.Value = bjmodel.ajother;

                //消防方案审查 
                xffa.Value = bjmodel.xffa.ToString();

                //消防方案审查 其他
                xffaother.Value = bjmodel.xffaother;

                //消防初设审查 
                xffacs.Value = bjmodel.xffacs.ToString();

                //消防初设审查  其他
                xffacsother.Value = bjmodel.xffacsother;

                //环保审查  
                hbsc.Value = bjmodel.hbsc.ToString();

                //环保审查 其他
                hbscother.Value = bjmodel.hbscother;

                //市政审查意见 
                szsc.Value = bjmodel.szsc.ToString();

                //市政审查意见 其他
                szscother.Value = bjmodel.szscother;

                //
                ylsc.Value = bjmodel.ylsc.ToString();

                //
                ylscother.Value = bjmodel.ylscother;

                //
                ghys.Value = bjmodel.ghys.ToString();

                //
                ghysother.Value = bjmodel.ghysother;

                //
                gtys.Value = bjmodel.gtys.ToString();

                //
                gtysother.Value = bjmodel.gtysother;

                //
                xfys.Value = bjmodel.xfys.ToString();

                //
                xfysother.Value = bjmodel.xfysother;

                //
                fljc.Value = bjmodel.fljc.ToString();

                //
                fljcother.Value = bjmodel.fljcother;

                //
                ylys.Value = bjmodel.ylys.ToString();

                //
                ylysother.Value = bjmodel.ylysother;

                //
                hbys.Value = bjmodel.hbys.ToString();

                //
                hbysother.Value = bjmodel.hbysother;

                //
                jgba.Value = bjmodel.jgba.ToString();

                //
                jgbaother.Value = bjmodel.jgbaother;
                StringBuilder sb = new StringBuilder();
                sb.Append("<script type='text/javascript'>");
                sb.Append("$(function(){");
                sb.Append(" $('#" + ct1.ClientID + "').find('select').each(function(e){ var id = $(this).attr('id'); if ($(this).val() == 4) {  $(\"#\" + id + \"other\").show();}   });");
                sb.Append("});");
                sb.Append("</script>");
                ltrBJScript.Text = sb.ToString();
            }
            #endregion


        }

        #endregion
        #region 报建部保存
        /// <summary>
        /// 报建部保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (bjmodel == null)
            {
                bjmodel = new BJModel();
            }
            bjmodel.ProjectId = Convert.ToInt32(hfId.Value);
            bjmodel.lx = Convert.ToInt32(lx.Value);

            bjmodel.lxother = bjmodel.lx == 4 ? lxother.Value : "";
            bjmodel.ky = Convert.ToInt32(ky.Value);
            bjmodel.kyother = bjmodel.ky == 4 ? kyother.Value : "";
            bjmodel.xzyj = Convert.ToInt32(xzyj.Value);
            bjmodel.xzyjother = bjmodel.xzyj == 4 ? xzyjother.Value : "";
            bjmodel.ydgh = Convert.ToInt32(ydgh.Value);
            bjmodel.ydghother = bjmodel.ydgh == 4 ? ydghother.Value : "";
            bjmodel.fasc = Convert.ToInt32(fasc.Value);
            bjmodel.fascother = bjmodel.fasc == 4 ? fascother.Value : "";
            bjmodel.jsgc = Convert.ToInt32(jsgc.Value);
            bjmodel.jsgcother = bjmodel.jsgc == 4 ? jsgcother.Value : "";
            bjmodel.cssc = Convert.ToInt32(cssc.Value);
            bjmodel.csscother = bjmodel.cssc == 4 ? csscother.Value : "";
            bjmodel.sgbt = Convert.ToInt32(sgbt.Value);
            bjmodel.sgbtother = bjmodel.sgbt == 4 ? sgbtother.Value : "";
            bjmodel.zj = Convert.ToInt32(zj.Value);
            bjmodel.zjother = bjmodel.zj == 4 ? zjother.Value : "";
            bjmodel.aj = Convert.ToInt32(aj.Value);
            bjmodel.ajother = bjmodel.aj == 4 ? ajother.Value : "";
            bjmodel.sgxk = Convert.ToInt32(sgxk.Value);
            bjmodel.sgxkother = bjmodel.sgxk == 4 ? sgxkother.Value : "";
            bjmodel.xffa = Convert.ToInt32(xffa.Value);

            //
            bjmodel.xffaother = bjmodel.xffa == 4 ? xffaother.Value : "";

            //
            bjmodel.xffacs = Convert.ToInt32(xffacs.Value);

            //
            bjmodel.xffacsother = bjmodel.xffacs == 4 ? xffacsother.Value : "";

            //
            bjmodel.hbsc = Convert.ToInt32(hbsc.Value);

            //
            bjmodel.hbscother = bjmodel.hbsc == 4 ? hbscother.Value : "";

            //
            bjmodel.szsc = Convert.ToInt32(szsc.Value);

            //
            bjmodel.szscother = bjmodel.szsc == 4 ? szscother.Value : "";

            //
            bjmodel.ylsc = Convert.ToInt32(ylsc.Value);

            //
            bjmodel.ylscother = bjmodel.ylsc == 4 ? ylscother.Value : "";

            //
            bjmodel.ghys = Convert.ToInt32(ghys.Value);

            //
            bjmodel.ghysother = bjmodel.ghys == 4 ? ghysother.Value : "";

            //
            bjmodel.gtys = Convert.ToInt32(gtys.Value);

            //
            bjmodel.gtysother = bjmodel.gtys == 4 ? gtysother.Value : "";

            //
            bjmodel.xfys = Convert.ToInt32(xfys.Value);

            //
            bjmodel.xfysother = bjmodel.xfys == 4 ? xfysother.Value : "";

            //
            bjmodel.fljc = Convert.ToInt32(fljc.Value);

            //
            bjmodel.fljcother = bjmodel.fljc == 4 ? fljcother.Value : "";

            //
            bjmodel.ylys = Convert.ToInt32(ylys.Value);

            //
            bjmodel.ylysother = bjmodel.ylys == 4 ? ylysother.Value : "";

            //
            bjmodel.hbys = Convert.ToInt32(hbys.Value);

            //
            bjmodel.hbysother = bjmodel.hbys == 4 ? hbysother.Value : "";

            //
            bjmodel.jgba = Convert.ToInt32(jgba.Value);

            //
            bjmodel.jgbaother = bjmodel.jgba == 4 ? jgbaother.Value : "";

            //
            bjmodel.createUserid = AdminUser.Id;

            //
            bjmodel.createusername = AdminUser.UserName;
            bjmodel.createrealname = AdminUser.RealName;
            //
            bjmodel.createtime = DateTime.Now;
            if (CenterService.bJService.Save(bjmodel) > 0)
            {

               // JsHelper.AlertAndClose(this, "数据保存成功！");
            }
        }
        #endregion
        #region 设计部保存
        /// <summary>
        /// 设计部
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSJ_Click(object sender, EventArgs e)
        {
            if (sjmodel == null)
            {
                sjmodel = new SJModel();
            }
            //
            sjmodel.ProjectId = Convert.ToInt32(hfId.Value);

            //
            sjmodel.fasj = Convert.ToInt32(fasj.Value);

            //
            sjmodel.fasjother = sjmodel.fasj == 4 ? fasjother.Value : "";

            //
            sjmodel.dzkc = Convert.ToInt32(dzkc.Value);

            //
            sjmodel.dzkcother = sjmodel.dzkc == 4 ? dzkcother.Value : "";

            //
            sjmodel.cbsj = Convert.ToInt32(cbsj.Value);

            //
            sjmodel.cbsjother = sjmodel.cbsj == 4 ? cbsjother.Value : "";

            //
            sjmodel.sgt = Convert.ToInt32(sgt.Value);

            //
            sjmodel.sgtother = sjmodel.sgt == 4 ? sgtother.Value : "";

            //
            sjmodel.sgtsc = Convert.ToInt32(sgtsc.Value);

            //
            sjmodel.sgtscother = sjmodel.sgtsc == 4 ? sgtscother.Value : "";

            //
            sjmodel.sgtbg = Convert.ToInt32(sgtbg.Value);

            //
            sjmodel.sgtbgother = sjmodel.sgtbg == 4 ? sgtbgother.Value : "";

            //
            sjmodel.createuserid = AdminUser.Id;

            //工程技术控制
            sjmodel.gcjs = gcjs.Value;

            //工程收方控制
            sjmodel.gcsf = gcsf.Value;

            //工程中间验收
            sjmodel.gcys = gcys.Value;

            //工程验收控制
            sjmodel.jggl = jggl.Value;
            //
            sjmodel.createusername = AdminUser.UserName;
            sjmodel.createrealname = AdminUser.RealName;
            //
            sjmodel.createtime = DateTime.Now;

            if (CenterService.sJService.Save(sjmodel) > 0)
            {

                //JsHelper.AlertAndClose(this, "数据保存成功！");
            }


        }
        #endregion
        #region 预算结算部保存
        /// <summary>
        /// 预算结算部
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnYSJS_Click(object sender, EventArgs e)
        {

            if (ysjsmodel == null)
            {
                ysjsmodel = new YSJSModel();
            }
            //
            ysjsmodel.ProjectId = Convert.ToInt32(hfId.Value);

            //
            ysjsmodel.gs = Convert.ToInt32(gs.Value);

            //
            ysjsmodel.gsother = ysjsmodel.gs == 4 ? gsother.Value : "";

            //
            ysjsmodel.ysbz = Convert.ToInt32(ysbz.Value);

            //
            ysjsmodel.ysbzother = ysjsmodel.ysbz == 4 ? ysbzother.Value : "";

            //
            ysjsmodel.ysps = Convert.ToInt32(ysps.Value);

            //
            ysjsmodel.yspsother = ysjsmodel.ysps == 4 ? yspsother.Value : "";

            //
            ysjsmodel.zbxj = Convert.ToDecimal(zbxj.Value);

            //
            ysjsmodel.jssc = Convert.ToInt32(jssc.Value);

            //结算审查50万以下金额
            ysjsmodel.jsscother = ysjsmodel.jssc == 4 ? jsscother.Value : "";
            ysjsmodel.jsje = Convert.ToDecimal(jsje.Value);

            //
            ysjsmodel.jsps = Convert.ToInt32(jsps.Value);

            //结算评审（50-200万） 金额
            ysjsmodel.jspsother = ysjsmodel.jsps == 4 ? jspsother.Value : "";
            ysjsmodel.jspsje = Convert.ToDecimal(jspsje.Value);
            //
            ysjsmodel.jssj = Convert.ToInt32(jssj.Value);

            //结算审计(200万以上)
            ysjsmodel.jssjother = ysjsmodel.jssj == 4 ? jssjother.Value : "";
            ysjsmodel.jssjje = Convert.ToDecimal(jssjje.Value);
            //
            ysjsmodel.createuserid = AdminUser.Id;

            //
            ysjsmodel.createusername = AdminUser.UserName;
            ysjsmodel.createrealname = AdminUser.RealName;
            //
            ysjsmodel.createtime = DateTime.Now;

            if (CenterService.ySJSService.Save(ysjsmodel) > 0)
            {

                //JsHelper.AlertAndClose(this, "数据保存成功！");
            }

        }
        #endregion
        #region 招标办保存
        /// <summary>
        /// 招标办
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnZBB_Click(object sender, EventArgs e)
        {
            if (zbbmodel == null)
            {
                zbbmodel = new ZBBModel();
            }
            if (cwmodel == null)
            {
                cwmodel = new CWModel();
            }
            cwmodel.ProjectId = Convert.ToInt32(hfId.Value);
            //cwmodel.gckyf = !string.IsNullOrEmpty(zbje.Value) ? Convert.ToDecimal(zbje.Value) : 0;
            //cwmodel.jlfyf = !string.IsNullOrEmpty(jlfwf.Value) ? Convert.ToDecimal(jlfwf.Value) : 0;
            //cwmodel.kcfyf = !string.IsNullOrEmpty(kcfwf.Value) ? Convert.ToDecimal(kcfwf.Value) : 0;
            //cwmodel.sjfyf = !string.IsNullOrEmpty(sjfwf.Value) ? Convert.ToDecimal(sjfwf.Value) : 0;
            //cwmodel.gsfyf = !string.IsNullOrEmpty(gsfwf.Value) ? Convert.ToDecimal(gsfwf.Value) : 0;
            //cwmodel.zjzxfyf = !string.IsNullOrEmpty(zxf.Value) ? Convert.ToDecimal(zxf.Value) : 0;
            cwmodel.createuserid = AdminUser.Id;
            cwmodel.createusername = AdminUser.UserName;
            cwmodel.createrealname = AdminUser.RealName;
            cwmodel.createtime = DateTime.Now;

            CenterService.cWService.Save(cwmodel);


            //
            zbbmodel.ProjectId = Convert.ToInt32(hfId.Value);

            //委托代理机构
            zbbmodel.wtdljg = wtdljg.Value;

            //招标方式
            zbbmodel.zbfs = Convert.ToInt32(zbfs.Value);

            //
            zbbmodel.zbfsother = zbbmodel.zbfs == 4 ? zbfsother.Value : "";

            //中标单位名称
            zbbmodel.zbdw = zbdw.Value;

            //中标通知书
            zbbmodel.zbtzs = Convert.ToInt32(zbtzs.Value);

            //中标金额
            zbbmodel.zbje = !string.IsNullOrEmpty(zbje.Value) ? Convert.ToDecimal(zbje.Value) : 0;

            //履约保证金缴纳
            zbbmodel.lybzj = Convert.ToInt32(lybzj.Value);

            //施工合同是否签订
            zbbmodel.sght = Convert.ToInt32(sght.Value);

            //监理单位名称
            zbbmodel.jldw = jldw.Value;

            //监理服务费
            zbbmodel.jlfwf = !string.IsNullOrEmpty(jlfwf.Value) ? Convert.ToDecimal(jlfwf.Value) : 0;

            //跟审单位
            zbbmodel.gsdw = gsdw.Value;

            //跟审服务费
            zbbmodel.gsfwf = !string.IsNullOrEmpty(gsfwf.Value) ? Convert.ToDecimal(gsfwf.Value) : 0;

            //设计单位名称
            zbbmodel.sjdw = sjdw.Value;

            //设计服务费
            zbbmodel.sjfwf = !string.IsNullOrEmpty(sjfwf.Value) ? Convert.ToDecimal(sjfwf.Value) : 0;

            //勘察单位
            zbbmodel.kcdw = kcdw.Value;

            //勘察服务费
            zbbmodel.kcfwf = !string.IsNullOrEmpty(kcfwf.Value) ? Convert.ToDecimal(kcfwf.Value) : 0;

            //造价单位
            zbbmodel.zjdw = zjdw.Value;

            //咨询费
            zbbmodel.zxf = !string.IsNullOrEmpty(zxf.Value) ? Convert.ToDecimal(zxf.Value) : 0;

            //供货单位
            zbbmodel.ghdw = ghdw.Value;

            //是否签订供货合同
            zbbmodel.ghht = Convert.ToInt32(ghht.Value);




            //
            zbbmodel.createuserid = AdminUser.Id;

            //
            zbbmodel.createusername = AdminUser.UserName;
            zbbmodel.createrealname = AdminUser.RealName;
            //
            zbbmodel.createtime = DateTime.Now;

            if (CenterService.zBBService.Save(zbbmodel) > 0)
            {

                //JsHelper.AlertAndClose(this, "数据保存成功！");
            }
        }
        #endregion
        #region 工程部保存
        /// <summary>
        /// 工程部
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnGCB_Click(object sender, EventArgs e)
        {
            if (gcbmodel == null)
            {
                gcbmodel = new GCBModel();
            }
            //
            gcbmodel.ProjectId = Convert.ToInt32(hfId.Value);

            //工程推进情况
            gcbmodel.gctj = gctj.Value;

            //工程推进存在问题
            gcbmodel.tjwt = tjwt.Value;

            //需要领导解决问题
            gcbmodel.ldjj = ldjj.Value;

            //需要协调解决问题
            gcbmodel.xyxt = xyxt.Value;

            //工程质量（是否有质量事故）
            gcbmodel.gczl = Convert.ToInt32(gczl.Value);

            //工程安全（是否有安全事故）
            gcbmodel.gcaq = Convert.ToInt32(gcaq.Value);

            //
            gcbmodel.createuserid = AdminUser.Id;

            //
            gcbmodel.createusername = AdminUser.UserName;
            gcbmodel.createrealname = AdminUser.RealName;

            //
            gcbmodel.createtime = DateTime.Now;

            if (CenterService.gCBService.Save(gcbmodel) > 0)
            {

               // JsHelper.AlertAndClose(this, "数据保存成功！");
            }

        }
        #endregion
        #region 总工程师
        /// <summary>
        /// 总工程师
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //protected void btnZGCS_Click(object sender, EventArgs e)
        //{
        //    if (zgcsmodel == null) {
        //        zgcsmodel = new ZGCSModel();
        //    }

        //    zgcsmodel.ProjectId = Convert.ToInt32(hfId.Value);

        //    //工程技术控制
        //    zgcsmodel.gcjs = gcjs.Value;

        //    //工程收方控制
        //    zgcsmodel.gcsf = gcsf.Value;

        //    //工程中间验收
        //    zgcsmodel.gcys = gcys.Value;

        //    //工程验收控制
        //    zgcsmodel.jggl = jggl.Value;

        //    //
        //    zgcsmodel.createuserid = AdminUser.Id;

        //    //
        //    zgcsmodel.createusername = AdminUser.UserName;
        //    zgcsmodel.createrealname = AdminUser.RealName;
        //    //
        //    zgcsmodel.createtime = DateTime.Now;

        //    if (CenterService.zGCSService.Save(zgcsmodel) > 0)
        //    {

        //        JsHelper.AlertAndClose(this, "数据保存成功！");
        //    }
        //}
        #endregion
        #region 档案室保存
        /// <summary>
        /// 档案室
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDAS_Click(object sender, EventArgs e)
        {
            if (damodel == null)
            {
                damodel = new DAModel();
            }

            //
            damodel.ProjectId = Convert.ToInt32(hfId.Value);

            //
            damodel.ProjectTp = tpid;

            //工程结算审计提交情况
            damodel.sjjs = sjjs.Value;

            //档案交底
            damodel.dajd = Convert.ToInt32(dajd.Value);
            damodel.dajdother = damodel.dajd == 4 ? dajdother.Value : "";

            //基础验收
            damodel.jcys = Convert.ToInt32(jcys.Value);
            damodel.jcysother = damodel.jcys == 4 ? jcysother.Value : "";
            //主体验收
            damodel.ztys = Convert.ToInt32(ztys.Value);
            damodel.ztysother = damodel.ztys == 4 ? ztysother.Value : "";
            //档案专项验收
            damodel.dzzx = Convert.ToInt32(dzzx.Value);
            damodel.dzzxother = damodel.dzzx == 4 ? dzzxother.Value : "";
            //完工验收
            damodel.wgys = Convert.ToInt32(wgys.Value);
            damodel.wgysother = damodel.wgys == 4 ? wgysother.Value : "";
            //移交结算
            damodel.yjjs = Convert.ToInt32(yjjs.Value);
            damodel.yjjsother = damodel.yjjs == 4 ? yjjsother.Value : "";
            //
            damodel.createuserid = AdminUser.Id;
            damodel.createrealname = AdminUser.RealName;
            //
            damodel.createusername = AdminUser.UserName;

            //
            damodel.createtime = DateTime.Now;

            if (CenterService.dAService.Save(damodel) > 0)
            {

                //JsHelper.AlertAndClose(this, "数据保存成功！");
            }
        }
        #endregion
        #region 财务室
        /// <summary>
        /// 财务室
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnCW_Click(object sender, EventArgs e)
        {
            if (cwmodel == null)
            {
                cwmodel = new CWModel();
            }
            //
            cwmodel.ProjectId = Convert.ToInt32(hfId.Value);

            ////工程款应付
            //cwmodel.gckyf = Convert.ToDecimal(gckyf.Value);

            ////工程款已付
            //cwmodel.gckyif = !string.IsNullOrEmpty(gckyif.Value) ? Convert.ToDecimal(gckyif.Value) : 0;

            ////设计费应付
            //cwmodel.sjfyf = !string.IsNullOrEmpty(sjfyf.Value) ? Convert.ToDecimal(sjfyf.Value) : 0;

            ////设计费已付
            //cwmodel.sjfyif = !string.IsNullOrEmpty(sjfyif.Value) ? Convert.ToDecimal(sjfyif.Value) : 0;

            ////监理费应付
            //cwmodel.jlfyf = !string.IsNullOrEmpty(jlfyf.Value) ? Convert.ToDecimal(jlfyf.Value) : 0;

            ////监理费已付
            //cwmodel.jlfyif = !string.IsNullOrEmpty(jlfyif.Value) ? Convert.ToDecimal(jlfyif.Value) : 0;

            ////勘察费应付
            //cwmodel.kcfyf = !string.IsNullOrEmpty(kcfyf.Value) ? Convert.ToDecimal(kcfyf.Value) : 0;

            ////勘察费已付
            //cwmodel.kcfyif = !string.IsNullOrEmpty(kcfyif.Value) ? Convert.ToDecimal(kcfyif.Value) : 0;

            ////采购材料应付
            //cwmodel.cgclyf = !string.IsNullOrEmpty(cgclyf.Value) ? Convert.ToDecimal(cgclyf.Value) : 0;

            ////采购材料已付
            //cwmodel.cgclyif = !string.IsNullOrEmpty(cgclyif.Value) ? Convert.ToDecimal(cgclyif.Value) : 0;

            ////跟审费应付
            //cwmodel.gsfyf = !string.IsNullOrEmpty(gsfyf.Value) ? Convert.ToDecimal(gsfyf.Value) : 0;

            ////跟审费已付
            //cwmodel.gsfyif = !string.IsNullOrEmpty(gsfyif.Value) ? Convert.ToDecimal(gsfyif.Value) : 0;

            ////造价咨询费应付
            //cwmodel.zjzxfyf = !string.IsNullOrEmpty(zjzxfyf.Value) ? Convert.ToDecimal(zjzxfyf.Value) : 0;

            ////造价咨询费已付
            //cwmodel.zjzxfyif = !string.IsNullOrEmpty(zjzxfyif.Value) ? Convert.ToDecimal(zjzxfyif.Value) : 0;

            ////招标代理费应付
            //cwmodel.zbdlfyf = !string.IsNullOrEmpty(zbdlfyf.Value) ? Convert.ToDecimal(zbdlfyf.Value) : 0;

            ////招标代理费已付
            //cwmodel.zbdlfyif = !string.IsNullOrEmpty(zbdlfyif.Value) ? Convert.ToDecimal(zbdlfyif.Value) : 0;

            ////其他费用应付
            //cwmodel.qtfyyf = !string.IsNullOrEmpty(qtfyyf.Value) ? Convert.ToDecimal(qtfyyf.Value) : 0;

            ////其他费用已付
            //cwmodel.qtfyyif = !string.IsNullOrEmpty(qtfyyif.Value) ? Convert.ToDecimal(qtfyyif.Value) : 0;

            //其他费用描述
            cwmodel.qtfyms = qtfyms.Value;

            //
            cwmodel.createuserid = AdminUser.Id;

            //
            cwmodel.createusername = AdminUser.UserName;
            cwmodel.createrealname = AdminUser.RealName;
            //
            cwmodel.createtime = DateTime.Now;

            if (CenterService.cWService.Save(cwmodel) > 0)
            {

                //JsHelper.AlertAndClose(this, "数据保存成功！");
            }
        }
        #endregion
    }
}